package core.proxy;

import org.apache.log4j.Logger;

import core.manager.Manager;
import core.manager.Workflow;
import core.util.COREServiceRegistry;

/**
 *vProxy WFQueuemanager, implementazione P2P
 * @author Vincenzo Merlo, Scuderi Giovanni Luca, Paolo Giuffrida
 */
public class WFQueueManagerProxyP2P extends WFQueueManagerProxy {

    @SuppressWarnings("unused")
	private final Logger logger = COREServiceRegistry.getLogger(WFQueueManagerProxyP2P.class.toString());

    /**
     *
     */
    public WFQueueManagerProxyP2P() {
        super();
    }

    /**
     * dequeu sul manager
     * @return workflow 
     */
    @Override
    public Workflow dequeue() {
        return ((Manager) Manager.getInstance()).getWfQueue().dequeue();
    }

    /**
     *
     * @param wf
     * @return
     */
    @Override
    public int enqueue(Workflow wf) {        
        return ((Manager) Manager.getInstance()).getWfQueue().enqueue(wf);
    }

    /**
     *
     * @return
     */
    @Override
    public String toString() {
    	return WFQueueManagerProxyP2P.class.getSimpleName();
    }
}
